package com.cn.component.valdation;

import javax.servlet.http.HttpServletRequest;


import com.jfinal.core.Controller;


public class VerifyLoginControoller extends Controller {


	public boolean valdation(HttpServletRequest request) {
		// get session to share the object
		GeetestLib geetest = GeetestLib.getGtSession(request);
		int gt_server_status_code = GeetestLib.getGtServerStatusSession(request);
		String gtResult = "fail";
		if (gt_server_status_code == 1) {
			gtResult = geetest.enhencedValidateRequest(request);
			System.out.println(gtResult);
		} else {
			System.out.println("failback:use your own server captcha validate");
			gtResult = "fail";
			gtResult=geetest.failbackValidateRequest(request);
		}

		if (gtResult.equals(GeetestLib.success_res)) {
			return true;
		} else{
			return false;
		}

	}
}
